﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace StockPortfolio
{
    public partial class frmGraph : Form
    {
        public frmGraph()
        {
            InitializeComponent();

            
            //this.label12.Location = new System.Drawing.Point(8, 159);
            //this.label12.Name = "label12";
            //this.label12.Size = new System.Drawing.Size(104, 23);
            //this.label12.TabIndex = 10;
            //this.label12.Text = "Gas";
            //this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
        }


       // string Rent = "";
       // string Car = "";
       // string School = "";
       // string Elec = "";
       // string Gas = "";
       // string CC = "";

             
       ////open connection to the sql database
       //objsqlConnection.Open();
       ////create new instance of sql data reader
       //SqlDataReader objGetData = objsqlCommandgetnames.ExecuteReader();


       //   //populate the balace label
       //    sqlConnectionBook.Open();
       //    SqlDataReader objGetDataBalance = sqlGetBalance.ExecuteReader();

       //   objGetDataBalance.Close();
       //    sqlConnectionBook.Close();
       //    //while statment that retrieves all the values from the database (checking)
           
       //    while (objGetData.Read())
       //    {
       //        txtRent.Text = Convert.ToString(objGetData["Rent"]);
       //        txtCar.Text = Convert.ToString(objGetData["Car"]);
       //        txtSchool.Text = Convert.ToString(objGetData["School"]);
       //        txtElec.Text = Convert.ToString(objGetData["Electricity"]);
       //        txtGas.Text = Convert.ToString(objGetData["Gas"]);
       //        txtCC.Text = Convert.ToString(objGetData["CreditCard"]);
            
            
       //        //Convert the values in the table to integers
       //        Rent = Convert.ToString(objGetData["Rent"]);
       //        Car= Convert.ToString(objGetData["Car"]);
       //        School = Convert.ToString(objGetData["School"]);
       //        Elec = Convert.ToString(objGetData["Electricity"]);
       //        Gas = Convert.ToString(objGetData["Gas"]);
       //        CC = Convert.ToString(objGetData["CreditCard"]);
              
       //        //Display the total in total textbox
       //        txttotal.Text = String.Format("{0:C}", (Rent + Car + School + Elec + Gas + CC));
               
       //    }

       //    objGetData.Close();
       //    objsqlConnection.Close();
        
           //while (objGetDataBalance.Read())
           //{
           //    lblBalance.Text = Convert.ToString(objGetDataBalance["Balance"]);    
           //}




    //    protected override void OnPaint(PaintEventArgs e)
    //    {
        
    //       //Graphics newImg = e.Graphics;
           
    //       //Image img = new Bitmap("../earth.gif");
           
    //       //newImg.DrawImage(img, 10, 10, 100, 100);
       
    //       // CHECK drwCheck = new CHECK();
    //        int xCol = 0;
    //        xCol = xCol + 20;
    //       // int months = Convert.ToInt32(drwCheck.DATE);
    //       // int dwBal = Convert.ToInt32(drwCheck.BAL);
    //        Point[] graphPoints = new Point[12];
    //        for(int i = 0; i <= 11; i++)
    //        {
    //           // graphPoints[i].X = (xCol + 20);
    //        }

    //        ///Graphics drwGraph = this.CreateGraphics();
    //        Graphics drwGraph1 = e.Graphics;
    //        //this.Show();
    //        Pen BluePen = new Pen(Color.Gold, 3);
    //        drwGraph1.DrawRectangle(BluePen, 0, 0, 600, 250);
    //        Point home = new Point(5, 50);
    //        Point month = new Point();
    //        Point month2 = new Point(150,100);
    //        month.X = 100;
    //        month.Y = 150;
    //        drwGraph1.DrawLine(BluePen, home, month);
    //        drwGraph1.DrawLine(BluePen, month, month2);
    //        Pen RedPen = new Pen(Color.Red, 2);
    //        drwGraph1.DrawEllipse(RedPen, 100, 150, 10, 10);
    //        Brush goldenBrush = Brushes.Green;
    //       // drwGraph1.FillEllipse(goldenBrush,0,0,50,100);
    //        base.OnPaint(e);
    //        // add 5 so the bars fit properly 
    //       // int x = 240; // the position of the X axis 
    //       // int y = 0; // the position of the Y axis 
    //       //// Bitmap bmp = new Bitmap(360, 290);  
    //       // //Graphics g = Graphics.FromImage(bmp); 
    //       // drwGraph1.DrawLine (new Pen(Color.Red, 2), 5,5, 5,250);
    //       // drwGraph1.DrawLine(new Pen(Color.Red, 2), 5, 250, 300, 250); 
    //       // // let's draw a coordinate equivalent to (20,30) (20 up, 30 across) 
    //       // drwGraph1.DrawString("X", new Font("Calibri", 12), new SolidBrush(Color.Black), y + 30, x - 20);    
    //       // PictureBox display = new PictureBox();   
    //       // display.Width = 360;   
    //       // display.Height = 290;    
    //       // this.Controls.Add(display); 
    //        //display.Image = bmp;          
    //    }
    }
}
